package com.jinlia.show.modules.wxapp.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jinlia.show.common.core.utils.UserInfoUtils;
import com.jinlia.show.modules.base.wxapp.entity.SignLog;
import com.jinlia.show.modules.base.wxapp.service.SignLogMapperService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequiredArgsConstructor
@RequestMapping("/sign/log")
public class SignLogController {
    @Autowired
    SignLogMapperService signLogMapperService;


    @PostMapping("add")
    public SignLog add(@RequestBody SignLog signLog) {
        signLog.setUserId(UserInfoUtils.getUserId());
        return signLogMapperService.add(signLog);
    }
    @PostMapping("list")
    public List<SignLog> list(@RequestBody SignLog signLog) {
        signLog.setUserId(UserInfoUtils.getUserId());
        return signLogMapperService.getList(signLog);
    }
}
